--INSERT DEAN
INSERT INTO DEAN (TENDA,MADA,DDIEM_DA,PHONG)
VALUES ('SAN PHAM Y',2,'NHA TRANG',1)
INSERT INTO DEAN (TENDA,MADA,DDIEM_DA,PHONG)
VALUES ('SAN PHAM Z',3,'TP HCM',5)
INSERT INTO DEAN (TENDA,MADA,DDIEM_DA,PHONG)
VALUES ('SAN PHAM X',5,'VUNG TAU',1)
INSERT INTO DEAN (TENDA,MADA,DDIEM_DA,PHONG)
VALUES ('TIN HOC HOA',10,'HA NOI',4)
INSERT INTO DEAN (TENDA,MADA,DDIEM_DA,PHONG)
VALUES('hoa hoc',40,'bien hoa',5)
--INSERT DIEDIEM_PHG
INSERT INTO DIADIEM_PHG (MAPHG,DIADIEM)
VALUES (1,'VUNG TAU')
INSERT INTO DIADIEM_PHG (MAPHG,DIADIEM)
VALUES (2,'TP HCM')
INSERT INTO DIADIEM_PHG (MAPHG,DIADIEM)
VALUES (3,'NHA TRANG')
INSERT INTO DIADIEM_PHG (MAPHG,DIADIEM)
VALUES (4,'TP HCM')
INSERT INTO DIADIEM_PHG (MAPHG,DIADIEM)
VALUES (5,'HA NOI')
INSERT INTO DIADIEM_PHG (MAPHG,DIADIEM)
VALUES (5,'TP HCM')
--INSERT NHANVIEN
IF EXISTS (Select * from dbo.Sysobjects where name ='NHANVIEN')
BEGIN
DROP TABLE NHANVIEN
END
GO
CREATE TABLE NHANVIEN
(
	HONV		NVARCHAR(10),
	TENLOT		NVARCHAR(20),
	TENNV		NVARCHAR(10),
	MANV		VARCHAR(10),
	NGSINH		DATETIME,
	DCHI		NVARCHAR(100),
	PHAI		NVARCHAR(5),
	LUONG		NUMERIC,
	MA_NQL		VARCHAR(10),
	PHG			INT
PRIMARY KEY (MANV)
)
INSERT INTO NHANVIEN (HONV,TENLOT,TENNV,MANV,NGSINH,DCHI,PHAI,LUONG,MA_NQL,PHG)
VALUES ('CAO','SI','KI','123123456','08/09/1986','123 LE LOI Q1 TPHCM','NAM',15000,'123456789',5)
INSERT INTO NHANVIEN (HONV,TENLOT,TENNV,MANV,NGSINH,DCHI,PHAI,LUONG,MA_NQL,PHG)
VALUES ('DINH','BA','TIEN','123456789','01/09/1955','731 TRAN HUNG DAO Q1 TP HCM','NAM',30000,'123456789',5)
INSERT INTO NHANVIEN (HONV,TENLOT,TENNV,MANV,NGSINH,DCHI,PHAI,LUONG,MA_NQL,PHG)
VALUES ('TRUONG','LE','DOAN','147852369','05/15/1986','22/41/2 LE VAN THO F11 GO VAP','NU',16500,'147852369',1)
INSERT INTO NHANVIEN (HONV,TENLOT,TENNV,MANV,NGSINH,DCHI,PHAI,LUONG,MA_NQL,PHG)
VALUES ('NGUYEN','THANH','TUNG','333445555','12/08/1945','638 NGUYEN VAN CU Q5 TP HCM','NAM',40000,'333445555',5)
INSERT INTO NHANVIEN (HONV,TENLOT,TENNV,MANV,NGSINH,DCHI,PHAI,LUONG,MA_NQL,PHG)
VALUES ('LE','HUYNH','DUC','666884444','06/01/1986','126 NGUYEN VAN CU Q5 TP HCM','NAM',27000,'666884444',1)
INSERT INTO NHANVIEN (HONV,TENLOT,TENNV,MANV,NGSINH,DCHI,PHAI,LUONG,MA_NQL,PHG)
VALUES ('VUONG','NGOC','QUYEN','888665555','09/15/1965','414 NO TRANG LONG QUAN BINH THANH TP HCM','NAM',29400,'999887777',4)
INSERT INTO NHANVIEN (HONV,TENLOT,TENNV,MANV,NGSINH,DCHI,PHAI,LUONG,MA_NQL,PHG)
VALUES ('LE','THI','NHAN','987654321','06/20/1931','291 HO VAN HUE QUAN PHU NHUAN TP HCM','NU',43000,'123456789',5)
INSERT INTO NHANVIEN (HONV,TENLOT,TENNV,MANV,NGSINH,DCHI,PHAI,LUONG,MA_NQL,PHG)
VALUES ('VO','DUC','MINH','987987987','09/16/1985','414 NO TRANG LONG QUAN BINH THANH TP HCM','NAM',30000,'123456789',5)
INSERT INTO NHANVIEN (HONV,TENLOT,TENNV,MANV,NGSINH,DCHI,PHAI,LUONG,MA_NQL,PHG)
VALUES ('BUI','THUY','VU','999887777','07/19/1958','332 NGUYEN THAI HOC Q1 TP HCM','NAM',25000,'123456789',4)

--INSERT PHONGBANIF EXISTS (Select * from dbo.Sysobjects where name ='PHONGBAN')
INSERT INTO PHONGBAN (TENPHG,MAPHG,TRPHG,NG_NHANCHUC)
VALUES ('QUAN LY',1,'666884444','06/19/1971')
INSERT INTO PHONGBAN (TENPHG,MAPHG,TRPHG,NG_NHANCHUC)
VALUES ('TO CHUC',2,'987987987','01/15/2001')
INSERT INTO PHONGBAN (TENPHG,MAPHG,TRPHG,NG_NHANCHUC)
VALUES ('NHAN SU',3,'987654321','02/16/2002')
INSERT INTO PHONGBAN (TENPHG,MAPHG,TRPHG,NG_NHANCHUC)
VALUES ('DIEU HANH',4,'123456789','01/01/1985')
INSERT INTO PHONGBAN (TENPHG,MAPHG,TRPHG,NG_NHANCHUC)
VALUES ('NGHIEN CUU',5,'333445555','05/22/1978')	
--INSERT THANNHAN
INSERT INTO THANNHAN (MA_NVIEN,TENTN,PHAI,NGSINH,QUANHE)
VALUES ('333445555','CHAU LONG','NAM','01/02/2005','CHONG')
INSERT INTO THANNHAN (MA_NVIEN,TENTN,PHAI,NGSINH,QUANHE)
VALUES ('333445555','KHANG','NAM','10/25/1973','CON TRAI')
INSERT INTO THANNHAN (MA_NVIEN,TENTN,PHAI,NGSINH,QUANHE)
VALUES ('333445555','NGOC PHI','NU','04/05/1976','CON GAI')
INSERT INTO THANNHAN (MA_NVIEN,TENTN,PHAI,NGSINH,QUANHE)
VALUES ('987654321','DANG','NAM','02/29/1932','VO CHONG')
INSERT INTO THANNHAN (MA_NVIEN,TENTN,PHAI,NGSINH,QUANHE)
VALUES ('999887777','TOAN','NAM','01/02/1986','CHONG')
--INSERT PHANCONG
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('123123456',2,NULL)
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('123123456',40,NULL)
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('123456789',40,10)
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('147852369',40,NULL)
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('333445555',2,NULL)
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('333445555',40,NULL)
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('666884444',40,NULL)
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('888665555',2,NULL)
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('987654321',40,NULL)
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('987987987',40,NULL)
INSERT INTO PHANCONG (MA_NVIEN,SODA,THOIGIAN)
VALUES ('999887777',40,NULL)
